import request from '@/utils/request'
// 月卡管理
export const getCardListAPI = (params) => {
  return request({
    url: '/parking/card/list',
    method: 'GET',
    params
  })
}

// 新增月卡
export const addCardAPI = (data) => {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}

// 编辑月卡
export const editCardAPI = (id) => {
  return request({
    url: `/parking/card/detail/${id}`
  })
}

// 更新
export const updateCardAPI = (data) => {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}

// 删除月卡
export const deleteCardAPI = (id) => {
  return request({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}

// 批量删除月卡
export const deleteCardBatchAPI = (idList) => {
  return request({
    url: `/parking/card/${idList.join(',')}`, // 每个id之间用逗号隔开，所以用 join(',')拼接
    method: 'DELETE'
  })
}
